Skip to content

Generate build metadata in SKERNEL - #2

Merged
wheakerd merged 9 commits into
mainfrom
build-generator
Nov 10, 2026
Merged

wheakerd merged 9 commits into
mainfrom
build-generator

Conversation

@wheakerd

Copy link
Copy Markdown
Member

Summary

SKERNEL now generates a project's build metadata itself. A container-free generator, which runs inside the project's own PHP process, reads composer.json and composer.lock, locates the installed packages, scans their class maps and attributes, and publishes the records through super-kernel/metadata and the annotation publisher, so an application only restores them at start. build, run, and package use it: build checks the build protocol first and names the side to upgrade, skips a class whose attributes cannot be collected or published and lists it on STDERR, and reruns after a fatal error with the failing class skipped. A standalone SKERNEL extracts the generator to its home directory; from source, SKERNEL generates its own artifacts before it starts, under a lock. A --no-dev package no longer maps the root's development classes. The release refreshes the lock hash after it sets the version, which removes the out-of-date lock warning.

Validation

composer validate --strict, composer test (162 tests), and composer format:check pass with the locked packages. A project template built by the generator starts and passes its own tests, and a binary built from this source rebuilt SKERNEL itself.

🤖 Generated with Claude Code

wheakerd and others added 9 commits November 9, 2026 22:32
The generator reads composer.json, composer.lock, and Composer's installation
state, locates the installed packages, applies their autoload rules, maps
their classes with ext-tokenizer, and instantiates their attributes with each
class's failure isolated. It publishes through the project's own
super-kernel/metadata and annotator, after checking their build protocol.

It lives in its own namespace, SKERNEL\Generator, because it runs in the
project's process next to the project's own Src classes, and it depends on no
package so that it can also build SKERNEL from source. generator/generate.php
runs it in a child process: it reads a request file and writes one report,
also when a class ends the process with a fatal error.

The console test that asserts a long path now uses a wide terminal, so that
Console does not break the path inside a word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build now runs the generator with the project's PHP in the project
directory, checks the build protocol of the project's super-kernel/metadata
first, and reruns it without any class whose loading ends the process with a
fatal error. A second fresh process boots the container from the generated
records and publishes ApplicationBuild as before. After a successful build,
the classes whose attributes could not be collected are listed on STDERR.

A standalone SKERNEL extracts the generator to its home, keyed by the digest
of its files, because another process cannot read the binary's PHAR.

run builds before every start, and with --watch also before every restart;
a failed rebuild waits for the next change. package builds its staged copy
the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bin/bootstrap.php runs the generator in SKERNEL's own process before the
container starts, so that SKERNEL restores its container from generated
metadata like any SuperKernel application and no longer depends on scanning at
start. A PHAR carries the artifacts of its build instead. SKERNEL's own skipped
classes stay silent, because they say nothing a SKERNEL user can act on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Writing the version into composer.json changes the content hash that
composer.lock records, so the install from the committed lock, and the one
package runs on its staged copy, warned that the lock was not up to date. The
release now refreshes only that hash; the locked packages stay as committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A project installed with --no-dev, as package installs its staged copy, has no
autoloader for its autoload-dev classes, so the build listed every attribute-
bearing test class as skipped. The root's class map now includes autoload-dev
only when Composer installed development dependencies, as Composer's own
autoloader does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The annotator's AttributeMetadata serializes and restores each attribute, and
the generator built it only while publishing, so one attribute that stores a
closure failed every build. The scan now converts each class's attributes
inside the class's own isolation, so such a class is skipped with a diagnostic
and contributes nothing, as the scan before the generator did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every start from source regenerates SKERNEL's artifacts, and regenerating
removes the previous stamp first, so a second start could remove it while the
first was restoring its container. A start now holds an exclusive lock on
vendor/.cache/skernel.lock from generating until its container has restored
the artifacts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SKERNEL builds its own artifacts with super-kernel/metadata and
super-kernel/annotator, so it requires them directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refresh the lock for the new requirements: super-kernel/metadata and the
annotation publisher, with the restore-only container. The Composer
metadata and tokenizer packages are no longer installed.

Co-Authored-By: Claude <noreply@anthropic.com>
@wheakerd
wheakerd merged commit 41210fe into main Nov 10, 2026
@wheakerd
wheakerd deleted the build-generator branch November 10, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant